﻿@model Biblioteca.Logica_Negocio.Domain_Model.Material
@{
    ViewBag.Title = "Crear Material";
}

<h2>Nuevo Material</h2>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)

     <fieldset>
        <legend>Material</legend>
        <div class="editor-label">
            @Html.Label("Autores")
        </div>
        <div class="editor-field">
            @Html.DropDownList("Autores", new SelectList(ViewData["Autores"] as System.Collections.IEnumerable, "Id", "NombreCompleto"))
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Titulo)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Titulo)
            @Html.ValidationMessageFor(model => model.Titulo)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Codigo)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Codigo)
            @Html.ValidationMessageFor(model => model.Codigo)
        </div>

        <div class="editor-label">
            @Html.Label("Tipo")
        </div>
        <div class="editor-field">
            @Html.DropDownList("Tipo", new SelectList(ViewData["Tipos"] as System.Collections.IEnumerable, "Id", "Tipo"))
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Sinopsis)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Sinopsis)
            @Html.ValidationMessageFor(model => model.Sinopsis)
        </div>

        <div class="editor-label">
            @Html.Label("Temas")
        </div>
        <div class="editor-field">
            @Html.DropDownList("Temas", new SelectList(ViewData["Temas"] as System.Collections.IEnumerable, "Id", "Nombre"))
        </div>

        <div class="editor-label">
            @Html.Label("Editorial")
        </div>
        <div class="editor-field">
            @Html.DropDownList("Editoriales", new SelectList(ViewData["Editoriales"] as System.Collections.IEnumerable, "Id", "Nombre"))
        </div>
        <p>
            <input type="submit" value="Crear" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Volver", "Index")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
